package com.example.demo.core.service;

import com.example.demo.core.event.EmailEvent;
import com.example.demo.entity.listener.OrderEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

/**
 * @author xkx
 * @version 1.0.0
 * @datetime 2019/1/22 15:45
 * @description
 */
@Service
public class EmailService {

  @Autowired
  private ApplicationContext context;

  public void publishEmail() {
    EmailEvent emailEvent = new EmailEvent("hello", "xkx055536@126.com", "想一条slogan");
    context.publishEvent(emailEvent);
  }
}